package com.wisezone.demo0218;

import java.lang.reflect.Field;

public class TestCreature {
    public static void main(String[] args) {
//        Creature<String> creature=new Creature<>();
//        creature.height=90.0;
        try {
            Class<Creature> creatureClass=Creature.class;
            Object cr=creatureClass.newInstance();
            Field field =creatureClass.getDeclaredField("height");
            field.setAccessible(true);
            field.set(cr,90.1);
            if(cr instanceof Creature)
            {
                Creature<?> creature=(Creature)cr;
                creature.breath();
            }

        } catch (Exception e) {
            e.printStackTrace();
        }


    }
}
